<?php
move_uploaded_file($_FILES["file"]["tmp_name"],
      "images/" . $_FILES["file"]["name"]);
      echo "Stored in: " . "images/" . $_FILES["file"]["name"];

      
      $img_name = $_FILES["file"]["name"];
      
      //echo $img_name;exit;
      $conn = mysql_connect('localhost','root','');
      mysql_select_db('demo',$conn);
      
      $sql = "INSERT INTO users(username,password,image)
      		  VALUES('member','1234','images/$img_name')";
      
      mysql_query($sql,$conn);
      
      $sql = "SELECT * FROM users WHERE image = 'images/$img_name'";
      $objData = mysql_query($sql,$conn);
      $row = mysql_fetch_assoc($objData);
      ?>
      
      <img src='<?php echo $row['image']; ?>' width='200' height='200'/>
      
      <?php 
      		mysql_close($conn);
      ?>
      
      